Repository navigation
Follow new chat messages after the chat returns from the background - #3374
Open
StylianosGakis wants to merge 1 commit into
Open
StylianosGakis wants to merge 1 commit into
StylianosGakis wants to merge 1 commit into
Conversation
After the chat screen had been in the background for more than a few seconds, newly arrived messages stopped being scrolled into view for as long as the screen stayed open. The presenter restarts on return and hands the screen a new LazyPagingItems, but ScrollToBottomEffect kept waiting on the instance it captured when it first launched, so it never saw the new message and timed out. The effect now reads the current list through rememberUpdatedState.
StylianosGakis
marked this pull request as ready for review
November 13, 2026 16:17
StylianosGakis
enabled auto-merge
November 13, 2026 16:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 AI description
A chat left open in the background stopped scrolling to new messages. Reproduce on develop: open a conversation at the newest message, press Home, wait about 25 seconds, have support reply, return. The reply is loaded but sits below the visible area, and the list stays stuck from then on, even for messages sent from that screen.
ScrollToBottomEffectis keyed on the list state only, so it kept the firstLazyPagingItemsit was called with. The presenter stops 5 seconds after the screen is backgrounded, and on return the screen gets a newLazyPagingItems. The effect went on observing the old one, hit its one second timeout and never scrolled.itemSnapshotListis snapshot state, but of that one instance, so the fix reads the list throughrememberUpdatedState, as the function already does for the latest message.Checked on a Pixel 6 Pro with the scenario above: stuck before, follows after. No test here: the module has no Compose UI test setup on develop.